<?php
abstract class GaAPI_Objects_Common_Enum {

    protected $_values = array();
    protected $_value = ' ';

    public function set($value) {
        if (!in_array($value, $this->_values)) {
            throw new Exception("Invalid value [$value] for " . get_class($this));
        }
        $this->_value = $value;
    }

    public function get() {
        return $this->_value;
    }

    public function __toString() {
        $value = $this->get();
        return $value;
    }
}